<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>合班</title>
	<%
    	String path = request.getContextPath();
	    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
    %>
	<c:set var="path" value="<%=basePath %>"></c:set>
 	<link href="${path }/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
 	<link href="${path }/css/form-public.css" rel="stylesheet" />
 	<link rel="stylesheet" type="text/css" href="${path }/js/zeroModal/zeroModal.css" />
 	<link rel="stylesheet" href="./layui/css/layui.css"  media="all">
</head>
<body>
<form class="layui-form layui-form-pane" action="addtime" method="post">
  <div style="padding-top: 0px;padding-left: 400px">
  	  <div style="margin-left: 50px;padding-bottom: 10px;color:red">
  	  	<h2 id="divs">修改上课时间</h2>
  	  </div>
  	  <input type="hidden" id="hiddenId" name="hiddenId"/>
	  <div class="layui-form-item">
	  	<label class="layui-form-label">上课时间</label>
	  	<div class="layui-input-inline" style="width: 120px">
	  	  <input type="text" class="layui-input" name="uptime" id="uptime" placeholder="HH:mm:ss"/>
		  </div>
	  </div>
	  <div class="layui-form-item">
	  	<label class="layui-form-label">下课时间</label>
	  	<div class="layui-input-inline" style="width: 120px">
	  	  <input type="text" class="layui-input" name="breaktime" id="breaktime" placeholder="HH:mm:ss"/>
		  </div>
	  </div>
	  <div class="layui-form-item">
	  	<label class="layui-form-label">晚自习时间</label>
	  	<div class="layui-input-inline" style="width: 120px">
	  	 	<input type="text" class="layui-input" name="Latetime" id="Latetime" placeholder="HH:mm:ss"/>
		  </div>
	  </div>
	  <div class="layui-form-item">
	  	<label class="layui-form-label">开空调时间</label>
		  <div class="layui-input-inline" style="width: 120px">
			 <input type="text" class="layui-input"  name="ontime" id="ontime" placeholder="HH:mm:ss"/>   
		  </div>
	  </div>
	  <div class="layui-form-item">
	  	<label class="layui-form-label">关空调时间</label>
		 <div class="layui-input-inline" style="width: 120px">
			<input type="text" class="layui-input" name="offtime" id="offtime" placeholder="HH:mm:ss"/>
		  </div>
	  </div>
	  
	  <div class="layui-form-item">
	    <div class="layui-input-block">
	      <button class="layui-btn" lay-submit="" lay-filter="demo1" onclick="ggg()">立即提交</button>
	      <button type="reset" onclick="goclass()" class="layui-btn layui-btn-primary">返回</button>
	    </div>
	  </div>
  </div>
</form>

<script type="text/javascript" src="./js/jquery-3.1.1.js"></script>
<script type="text/javascript" src="./js/jqueryui/jquery-ui.js"></script>
<script src="./layui/layui.js" charset="utf-8"></script>    
	
<script>
/* $(function(){
	gettecher();
}); */
function ggg(){
	console.log($("#onshi").val());
}
layui.use(['form', 'layedit', 'laydate'], function(){
	var form = layui.form;
	var laydate = layui.laydate;
	 //时间选择器
	  laydate.render({
	    elem: '#uptime'
	    ,type: 'time'
	  });
	  laydate.render({
		    elem: '#breaktime'
		    ,type: 'time'
	  });
	  laydate.render({
		    elem: '#Latetime'
		    ,type: 'time'
	  });
	  laydate.render({
		    elem: '#ontime'
		    ,type: 'time'
	  });
	  laydate.render({
		    elem: '#offtime'
		    ,type: 'time'
	   });
	  
		$.ajax({
			url:'getTimeById',
			datatype:'json',
			success:function(data){
				console.log(data.list.breaktime);
				$("#divs").html(data.list.classInfo.clazz_name+"班修改上课时间");
				$("#hiddenId").val(data.list.t_id);
				$("#uptime").val(data.list.uptime);
				$("#breaktime").val(data.list.breaktime);
				$("#Latetime").val(data.list.latetime);
				$("#ontime").val(data.list.ontime);
				$("#offtime").val(data.list.offtime);
				form.render(); //更新全部
			} 
		});
	
});
</script>
</body>
</html>